<template>
  <div class="classic-films">
    <div class="films-list">
      <div class="item" v-for="(item, index) in classicList" :key="index"
      @click="movieDeatil(item.movieId)">
        <div class="cover">
          <img class="auto-img" :src="item.poster" alt="" />
        </div>
        <div class="item-box">
          <div class="name">{{ item.movieInfo.title }}</div>
          <div class="foreign-name">{{ item.movieInfo.englishTitle }}</div>
          <div class="item-type">{{ item.movieInfo.actors }}</div>
          <div class="shown">{{ item.movieInfo.showInfo }}</div>
        </div>
        <div class="item-score">
          <span class="num">{{ item.score }}</span
          >分
        </div>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  name: "ClassicFilms",
  data() {
    return {
      classicList: [],
    };
  },
  created() {
    this.getClassicList();
  },
  methods: {
    // 获取经典电影列表数据
    getClassicList() {
      this.axios({
        method: "get",
        url: "index/moreClassicList",
        query: {
          limit: 10,
          offset: 0,
        },
      })
        .then((result) => {
          

          this.classicList = result.data;
          
        })
        .catch((err) => {
          
        });
    },
    // 点击跳转到影片详情
    movieDeatil(movieId) {
      // 获取点击的影片id
      
      this.$router.push({ name: "MovieDetail", params: { movieId } });
    },
  },
};
</script>

<style lang="less" scoped>
.classic-films {
  margin-top: 50px;
  margin-bottom: 50px;
}
.films-list {
  // border: 1px solid #00f;
  padding: 12px;
  .item {
    // border: 1px solid #000;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    &:last-child {
      margin-bottom: 0;
    }
    .cover {
      width: 70px;
    }
    .item-box {
      width: 200px;
      margin-left: -15px;
      .name {
        font-size: 17px;
        font-weight: bold;
        color: #333;
      }
      .foreign-name {
        font-size: 14px;
        color: #666;
        margin-top: 5px;
      }

      .item-type {
        font-size: 14px;
        color: #666;
        margin-top: 5px;
      }
      .shown {
        font-size: 14px;
        color: #666;
        margin-top: 5px;
      }
    }
    .item-score {
      // border: 1px solid #000;
      font-size: 14px;
      color: #999;
      margin-top: -60px;
      .num {
        font-size: 18px;
        color: #faaf00;
      }
    }
  }
}
</style>